tone_synth object
This method generates a given frequency or list of frequencies that will last for a specified number of beats.
bool freq(string frequencies, double length)
Parameters:
frequencies
A string specifying a frequency or list of frequencies to generate.
length
The length of the generated frequencies, in beats.
Return value:
true on success, false on failure.
Remarks:
Each frequency in the list is separated by a comma and space. Valid values are from 1 to 20000Hz. If the list does not meet the criteria the function will fail.
The frequencies provided in the list will be generated together (as opposed to separately, one after the other), allowing for easier and quicker creation of chords.
The length is specified in beats, based on the value of the tempo property.
Example:
// Write a C major chord using frequencies.
tone_synth synth;
void main()
{
synth.freq("262, 328, 394", 4);
synth.write_wave_file("wave.wav");
}